<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="model.Author"%>
<%@page import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- includes -->
<%@ include file="../includes/includes.jsp"%>
<!-- fin includes -->
<title>Insert title here</title>
</head>
<body>
<!-- cabecera -->
<%@ include file="../includes/header.jsp"%>
<!-- fin cabecera -->

<div id="main"><%@ page language="java" import="java.sql.*"%>
<%
	// add_res.jsp // form data
	//String user = request.getParameter("user");
	String author = request.getParameter("author");
	String email = request.getParameter("email"); // database parameters
	
	Author autor = new Author();
	
	boolean correcto = false;
	
	correcto = autor.addAuthor(author, email);
	
	if (correcto) {
		out.println("User succesfully added.");
		out.println("<br><br><a href='adduser.jsp'>Añadir otro usuario</a> | <a href='index.jsp'>Home</a> | <a href='addnews.jsp'>Añadir noticia</a>");
	} else {
		out.println("Error al inserta . Intentelo mas tarde.");
	} 
	
%>




</div>


<!-- menu  -->
<%@ include file="../includes/menu.jsp"%>
<!--  fin menu  -->

<!-- footer  -->

<%@ include file="../includes/footer.jsp"%>
<!--  fin footer -->

</body>
</html>